
public class Hezi {
    private final double[] heziBoxes;
    private final Object lockObj = new Object();
   
    public Hezi(int n,initialEnergy) {
	   heziBoxes = new double[n];
	   for(int i =0;i<heziBoxes.length;i++) 
		   heziBoxes = initialEnergy;
	   
   }
    public void transfer(int from,int to,double amount) {
    	synchronized(lockObj) {
    		while (heziBoxes[from]<amount) {
    			lockObj.wait();
    		}
    	}
    
    
    }
}
